import request from '@/utils/request.ts'

interface Response {
  code: number
  message: string
  data: any
}

// 获得所有订单记录
// GET /trade/history/get_orderHistory
// 接口ID：327440460
// 接口地址：https://app.apifox.com/link/project/5539657/apis/api-327440460
export const get_orderHistory = async (): Promise<Response> => {
  return request.get('/trade/history/get_orderHistory')
}

// 获得交易记录
// GET /trade/history/get_tradeHistory
// 接口ID：327438315
// 接口地址：https://app.apifox.com/link/project/5539657/apis/api-327438315
export const get_tradeHistory = async (orderID: string): Promise<Response> => {
  return request.get('/trade/history/get_tradeHistory', {
    params: {
      orderID
    },
  })
}

// 删除订单
//   DELETE /trade/history/delete_history
//   接口ID：327478354
//   接口地址：https://app.apifox.com/link/project/5539657/apis/api-327478354
export const delete_history = async (orderID: string): Promise<Response> => {
  return request.delete('/trade/history/delete_history', {
    params: {
      orderID
    }
  })
}

// 删除所有订单
// DELETE /trade/history/delete_allHistory
// 接口ID：327481548
// 接口地址：https://app.apifox.com/link/project/5539657/apis/api-327481548
export const delete_allHistory = async (): Promise<Response> => {
  return request.delete('/trade/history/delete_allHistory')
}
